<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>轮播图</title>
    <link rel="stylesheet" href="../assets/lib/layui/css/layui.css" />
    <link rel="stylesheet" href="../assets/css/swiper.css" />
  </head>
  <body>
    <div class="layui-card">
      <form class="layui-card-header">
        轮播图管理
        <input
          type="file"
          accept="image/*"
          multiple
          id="file"
          class="layui-hide"
        />
        <button type="button" class="layui-btn layui-btn-normal uploadBtn">
          <i class="layui-icon layui-icon-face-smile layui-icon-upload"></i
          >上传图片
        </button>
      </form>
      <div class="layui-card-body">
        <table class="layui-table">
          <colgroup>
            <col width="10%" />
            <col width="26%" />
            <col width="38%" />
            <col width="13%" />
            <col />
          </colgroup>
          <thead>
            <tr>
              <th>ID</th>
              <th>图片预览</th>
              <th>图片路径</th>
              <th>状态</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody id="tb">
            <tr>
              <td>贤心</td>
              <td>2016-11-29</td>
              <td>人生就像是一场修行</td>
              <td>人生就像是一场修行</td>
              <td>人生就像是一场修行</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <script type="text/html" id="tr">
      {{each data v i}}
      <tr data-id="{{v.id}}">
        <td>{{v.id}}</td>
        <td>
          <img src="http://localhost:8888/uploads/{{v.swiperimg}}" alt="" />
        </td>
        <td>{{v.swiperimg}}</td>
        <td>
          <span
            data-status="{{v.swiperstatus}}"
            class="layui-badge layui-bg-{{v.swiperstatus == 1 ? 'green' : 'black'}} status{{v.swiperstatus}}"
            >{{v.swiperstatus == 1 ? '√' : 'x'}}</span
          >
        </td>
        <td>
          <button
            type="button"
            class="layui-btn layui-btn-danger layui-btn-xs delete"
          >
            删除
          </button>
        </td>
      </tr>
      {{/each}}
    </script>
    <script src="../assets/lib/jquery.js"></script>
    <script src="../assets/lib/layui/layui.all.js"></script>
    <script src="../assets/lib/template-web.js"></script>
    <script src="../assets/js/common.js"></script>
    <script src="../assets/js/swiper.js"></script>
  </body>
</html>
